package cn.k.qo;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter
@Getter
public class ConsumptionReportQueryObject extends QueryObject {
    public int groupTypeId = 1;

    public String getGroupTypeDisplay() {
        if (groupTypeId == 1) {
            return "b.name";  //门店
        } else if (groupTypeId == 2) {
            return "YEAR(c.pay_time)";  //年
        } else if (groupTypeId == 3) {
            return "DATE_FORMAT(c.pay_time,'%Y-%m')";  //月
        } else if (groupTypeId==4){
            return "DATE_FORMAT(c.pay_time,'%Y-%m-%d')"; //日
        }else {
            return "不符合要求";
        }
    }

    public int businessId = -1;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    public Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    public Date endDate;

}
